$(function () {
    axios.get('http://jx.xuzhixiang.top/ap/api/all-province.php', {}).then((ret) => {
        let dZhi = ret.data.data
        console.log(dZhi);
    })
    console.log($(".swiper-slide"));
    let j = 0
    let timer = ""

    function move() {
        $(".swiper-slide").eq(j).css("opacity", "1").siblings(".swiper-slide").css("opacity", "0")
        $("#index-lunbo span").eq(j).css("background", "red").siblings().css("background", "black")
        j++
        if (j == $(".swiper-slide").length) {
            j = 0
        }
        if (j == -1) {
            j = $(".swiper-slide").length
        }
    }
    timer = setInterval(() => {
        move()
    }, 2000)
    $(".swiper-wrapper").mouseover(function () {
        clearInterval(timer)
    })
    $(".swiper-wrapper").mouseout(function () {
        timer = setInterval(() => {
            move()
        }, 2000)
    })
    $(".swiper-button-next").click(function () {
        move()
    })
    $(".swiper-button-prev").click(function () {
        j = j - 2
        move()
    })

    $(window).scroll(function () {
        let guTop = $("#index-flexd").offset().top
        let st = $(this).scrollTop()
        if (st >= 222) {
            $("#index-flexd").css({
                "position": "fixed",
                "top": "0px",
                "left": "164.6px",
                "z-index": "9"

            })
        } else {
            $("#index-flexd").css({
                "position": ""
            })
        }
    })
})